/* ======================================================================================== *\

		FILE:				PipeRenderer.h
		AUTHOR:				Jack Hoxley

		DESCRIPTION:		To facilitate the abstraction of multiple rendering processes
							the core application will use this interface. It defines the
							basic operations for resource management and rendering.

		CHANGE:				14th July 2007
								Defined basic interface

\* ======================================================================================== */

#ifndef INC_PIPERENDERER_H
#define INC_PIPERENDERER_H

#include "DXUT.h"

#include "PipeLayout.h"

namespace Renderer
{
	class PipeRenderer
	{
		public:
			// Called only when all resources have been lost (device removed)
			// or when the application is initialized. Once this function
			// returns it is assumed that any necessary internal data structures
			// have been allocated/created.
			virtual HRESULT CreateResources( ID3D10Device* pDevice, const PipeSim::PipeLayout * const p ) = 0;

			// Resource creation is an expensive process, but the data contained
			// within them changed on a regular basis. This operation facilitates
			// this pattern. When the pipe simulation is updated this operation
			// is invoked to allow internal resources to be updated to reflect
			// changes.
			virtual HRESULT UpdateResources( const PipeSim::PipeLayout * const p ) = 0;

			// Called only when this rendering method is no longer required or when
			// the OS/runtime requests that all resources be released.
			virtual HRESULT DestroyResources() = 0;

			// This operation is expected to configure the Direct3D pipeline however
			// is appropriate and despatch the appropriate draw calls to ensure
			// that the pipes are drawn to the display.
			virtual HRESULT Render( ID3D10Device* pDevice, D3DXMATRIX& mViewProj ) = 0;

			// Accurately measuring exact memory usage is difficult and arguably pointless
			// but this operation should give at least a rough indication of how resource
			// -hungry this rendering path is.
			virtual UINT32 VideoMemoryStorageInUse() = 0;

			// For the UI it might be appropriate to output a human-friendly name describing
			// this rendering path.
			virtual void RendererName( wchar_t* wcDestination, const size_t& DestinationSize ) = 0;
	};
};

#endif // INC_PIPERENDERER_H